import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

//测试DateFormat
public class TestDateFormat {
    public static void main(String[] args) throws ParseException {
        DateFormat format = new SimpleDateFormat("yyyy年MM-dd hh:mm:ss");
        String str = "2049年10-1 10:10:10";
        Date guoqing100 = format.parse(str);
        System.out.println(guoqing100.getTime());

        DateFormat format2 = new SimpleDateFormat("yyyy年MM月dd日 hh时mm分ss秒");
        Date date2 = new Date(1855425455252L);
        String date2Str = format2.format(date2);
        System.out.println(date2Str);
    }
}
